//
//  WeDetailLeaveMessageTitleVIew.m
//  WeGalaxy
//
//  Created by Zheng on 2017/6/29.
//  Copyright © 2017年 Zheng. All rights reserved.
//

#import "WeDetailLeaveMessageTitleView.h"

@implementation WeDetailLeaveMessageTitleView

#pragma mark - 初始化
- (instancetype)init {
    self = [super init];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        [self subiewsInView];
    }
    return self;
}

#pragma mark - 子视图
- (void)subiewsInView {
    [self addSubview:self.redView];
    [self addSubview:self.titleLbl];
    [self addSubview:self.lineView];
    
    [_redView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(12);
        make.width.mas_equalTo(5);
        make.height.mas_equalTo(20);
        make.top.mas_equalTo(12);
    }];
    
    [_titleLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_redView.mas_right).offset(7);
        make.centerY.equalTo(_redView);
    }];
    
    [_lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(self);
        make.height.mas_equalTo(0.5);
    }];
}

- (UIView *)redView {
    if (!_redView) {
        _redView = [UIView new];
        _redView.backgroundColor = kRGB_COLOR(242, 69, 54, 1);
    }
    return _redView;
}

- (UILabel *)titleLbl {
    if (!_titleLbl) {
        _titleLbl = [UILabel new];
        _titleLbl.font = kCX_FONT(14);
        _titleLbl.text = @"留言·2";
    }
    return _titleLbl;
}

- (UIView *)lineView {
    if (!_lineView) {
        _lineView = [UIView new];
        _lineView.backgroundColor = [UIColor lightGrayColor];
    }
    return _lineView;
}


@end
